package org.jeecg.modules.config.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.config.entity.WlhyBank;
import org.jeecg.modules.config.service.IWlhyBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;

import static org.jeecg.common.constant.WlhyBizConstant.*;

/**
 * @Description: 银行
 * @Author: jeecg-boot
 * @Date:   2024-04-10
 * @Version: V1.0
 */
@Api(tags="银行")
@RestController
@RequestMapping("/user-api/config/wlhyBank")
@Slf4j
public class WlhyBankApi extends JeecgController<WlhyBank, IWlhyBankService> {
	@Autowired
	private IWlhyBankService wlhyBankService;

	/**
	 * 银行列表
	 * @return
	 */
	//@AutoLog(value = "银行-银行列表")
	@ApiOperation(value="银行-银行列表", notes="银行-银行列表")
	@GetMapping(value = "/list")
	public Result<List<WlhyBank>> list() {
		LambdaQueryWrapper<WlhyBank> wrapper = new LambdaQueryWrapper<WlhyBank>()
				.eq(WlhyBank::getStatus, ROW_STATUS1)
				.orderByAsc(WlhyBank::getSort);
		List<WlhyBank> bankList = wlhyBankService.list(wrapper);
		return Result.OK( bankList);
	}


}
